/*
 * Copyright 2012 Gene Chen
 *
 *    Licensed under the Apache License, Version 2.0 (the "License");
 *    you may not use this file except in compliance with the License.
 *    You may obtain a copy of the License at
 *
 *        http://www.apache.org/licenses/LICENSE-2.0
 *
 *    Unless required by applicable law or agreed to in writing, software
 *    distributed under the License is distributed on an "AS IS" BASIS,
 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *    See the License for the specific language governing permissions and
 *    limitations under the License.
 */

package ubc.cs.cpsc210.sustainabilityapp;

import android.app.TabActivity;
import android.content.Intent;
import android.content.pm.ActivityInfo;
import android.content.res.Resources;
import android.os.Bundle;
import android.view.Window;
import android.widget.TabHost;

public class SelectPOIActivity extends TabActivity {
	TabHost tabHost;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);	
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT);
		
		setContentView(R.layout.selectpoi);
		
		Resources res = getResources();
		tabHost = getTabHost();

		TabHost.TabSpec spec;
		Intent intent;

		intent = new Intent().setClass(this, POIActivity.class);
		spec = tabHost.newTabSpec("poi").setIndicator("POI's",
				res.getDrawable(R.drawable.ic_tab_poi))
				.setContent(intent);
		tabHost.addTab(spec);

		intent = new Intent().setClass(this, FeatureActivity.class);
		spec = tabHost.newTabSpec("feature").setIndicator("Features",
				res.getDrawable(R.drawable.ic_tab_feature))
				.setContent(intent);
		tabHost.addTab(spec);
	}
	
	@Override public void onBackPressed() {
		finish();
	}
}
